<{:W('Bizhome/header',array($biz_item_num,$user))}>
    <div class="right_box">
		<div class="content">
			<div class="head_box">
				<h2>课程列表</h2>
			</div>
			
			<div class="info_table">
				<table>
					<tbody>
						<tr>
							<th>课程名称</th>
							<th>课程人数</th>
							<th>课程描述</th>
							<th>功能</th>
						</tr>
					<foreach name="data" item="vo" key="k" >
						<!-- <input type="hidden" name="competition_id" value="<{$vo.competition_id}>" /> -->
                        <tr class="alt">
                         	<td><{$vo.course_name}>	<input type="hidden" class="course_id" value="<{$vo.course_id}>"></input></td> 
                            						
                         	<td class="detail">
                         		<{$vo.course_student_number}><span>/</span><{$vo.course_schedule_st_number}><br>		
                         	</td>
                         	<td class="detail"><{$vo.course_description}></td>
                         	<td>
                         		<button onclick="course_detail(<{$k}>)">详情</button>
								<button onclick="delete_course(<{$k}>)">删除</button>
                         		<button onclick="edit_course(<{$k}>)">修改</button>
								<button onclick="get_apply_people(<{$k}>)">报名详情</button>
                         	</td>
                        </tr> 
                    </foreach>					              
					</tbody>
				</table>
				
			</div>	
			
			<div class="blank"></div>
			<!-- <div class="pages"> 1 条记录 1/1 页          </div> -->			
						
		

		</div>
	</div>	
</div>
<script>
  var selected;
  function course_detail(num)
  {
     var course_set=document.getElementsByClassName("course_id");
	 selected=course_set[num].value;
	 layer.open({
                 type: 2,
                 title: '课程详情',
                 maxmin: true,
                 shadeClose: true, //点击遮罩关闭层
                 area : ['600px' , '420px'],
                 content: 'course_detail.html'
				 });
  }
  function delete_course(num)
  {
     var course_set=document.getElementsByClassName("course_id");
	 selected=course_set[num].value;
	  layer.confirm('确定删除？', {
       btn: ['确定','取消'] //按钮
       }, function(){      
       $.post('__URL__/deleteCourse',{'course_id':selected},function(resultList){ 			   
			  msg=resultList.msg;
			  if (msg!=0) {
			    layer.msg('课程已开始，不能删除');
			  }
			  else 
			  {
			    layer.msg('删除成功');
			  }
    	     },'json');  
    }, function(){
      
    });
  }
  
  function get_apply_people(num)
  {
     var course_set=document.getElementsByClassName("course_id");
	 selected=course_set[num].value;
	 layer.open({
                 type: 2,
                 title: '报名详情',
                 maxmin: true,
                 shadeClose: true, //点击遮罩关闭层
                 area : ['600px' , '420px'],
                 content: 'apply_people.html'
				 });
  }
  function edit_course(num)
  {
     var course_set=document.getElementsByClassName("course_id");
	 selected=course_set[num].value;
	 $.post('__URL__/courseDetail',{'course_id':selected},function(resultList){ 			   
			  msg=resultList.msg;
			  if (msg!=0) {
			    layer.msg('课程已开始，不能修改');
			  }
			  else 
			  {
			     layer.open({
                 type: 2,
                 title: '修改课程',
                 maxmin: true,
                 shadeClose: true, //点击遮罩关闭层
                 area : ['600px' , '420px'],
                 content: 'edit_course.html'
				 });
			  }
    	     },'json'); 
  }
</script>
<div class="blank20"></div>
<{:W('Bizhome/footer')}>
